<LoadDialog>:
    BoxLayout:
        size: root.size
        pos: root.pos
        orientation: "vertical"
        FileChooserListView:
            id: filechooser
            path: root.cwdir
            dirselect: True
            filters: ['*']
            # on_selection: root.dispatch('on_selection', args[1])
            on_selection: text_input.text = self.selection and (self.selection[0].encode('utf-8')) or ''
            file_encodings:['utf-8']
        TextInput:
            id: text_input
            size_hint_y: .1
            multiline: False


        BoxLayout:
            size_hint_y: .1
            spacing: 30
            Button:
                text: "[b]Confirm[/b]"
                on_release: root.load(filechooser.path,text_input.text)
                markup: True

            Button:
                text: "[b]Cancel[/b]"
                on_release: root.cancel()
                markup: True

<SavePathDialog>:
    BoxLayout:
        size: root.size
        pos: root.pos
        orientation: "vertical"
        spacing: 30

        Label:
            text: '[b]Choose Output File Path:[/b][/ref]'
            color: kivy.utils.get_color_from_hex('#FFFFFF')
            font_size: 20  # 24
            markup: True
            size_hint_y: .1

        FileChooserListView:
            size_hint_y: .6
            id: filechooser
            path: root.dirname
            dirselect: True
            filters: ['*', '.']
            on_selection: file_output.text = root.action_choose_file(self.selection)

        TextInput:
            id: file_output
            size_hint_y: .1
            multiline: False
            text: root.file

        BoxLayout:
            size_hint_y: .1
            spacing: 30
            Button:
                text: "[b]Confirm[/b]"
                on_release: root.load(file_output.text)
                markup: True

            Button:
                text: "[b]Cancel[/b]"
                on_release: root.cancel()
                markup: True

<TranslationDialog>:
    BoxLayout:
        size: root.size
        pos: root.pos
        orientation: 'vertical'
        spacing: 30

        TextInput:
            id: translation_output
            readonly: True

        Button:
            id: translation_button_close
            text: 'Running...'
            size_hint_y: None
            height: '48dp'
            on_release: root.cancel()
            disabled: True

<DownloadDialog>:
    orientation: "vertical"
    Label:
        text: '[ref="click"][b]The mathtranslate had not been installed \n Or is not latest. \n\n Are you sure to Download it ?[/b][/ref]'
        color: kivy.utils.get_color_from_hex('#FFFFFF')
        font_size: 15 # 24
        markup: True
        size_hint_y: .2

    BoxLayout:
        size_hint_y: .05
        spacing: 30
        Button:
            text: "[b]Confirm[/b]"
            on_release: root.load()
            markup: True
        Button:
            text: "[b]Cancel[/b]"
            on_release: root.cancel()
            markup: True
